/**
 * Copyright (C), 2020-2021 by colley.ma
 * File Name: ClassLogFactory.java
 * Encoding: UTF-8
 * Date: 2021年6月25日 上午10:39:34
 * History:
*/
package com.swak.frame.logger;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class AspectLoggerFactory {

	private static Map<String, Logger> aspectLogClazzFactory = new ConcurrentHashMap<String, Logger>();

	public static Logger getLogger(Class<?> clazz) {
		return aspectLogClazzFactory.computeIfAbsent(clazz.getName(), k -> LoggerFactory.getLogger(clazz));
	}

	public static Logger getLogger(String name) {
		return aspectLogClazzFactory.computeIfAbsent(name, k -> LoggerFactory.getLogger(name));
	}
}